#include <signal.h>

static int __check_signal(int signum)
{
    switch (signum)
    {
    case SIGINT:
    case SIGILL:
    case SIGABRT:
    case SIGFPE:
    case SIGSEGV:
    case SIGTERM:
        return 0;
    default:
        break;
    }
    return -1;
}

int raise(int signum)
{
    NX_U32 tid;
    if (__check_signal(signum))
    {
        return -1;
    }

    tid = NX_ThreadGetCurrentId();
    if (NX_SignalSend(tid, (NX_Signal)signum, NX_NULL) != NX_EOK)
    {
        return -1;
    }
    return 0;
}
